/**
 * Created by Administrator on 2019/7/31.
 */
"use strict";
const requireEx=require('yi-require');

/*
* 根据手机号检查是否已经存在
* */
const handler = (req,res,next)=>{
    var phone = req.query.filter.mobile;
    delete req.query.filter.mobile;
    req.mongo.collection("user").find({"mobile":phone}).toArray(function(err,index){
        if (err) {
            return res.err.errorMongo(err);
        }
        if (index.length <= 0) {
            res.reply({code:0,message:false});
        } else {
            res.reply({code:0,message:true});
        }
    });
}

module.exports = {
    description: '根据手机号检查账户是否已经存在',
    handler: handler

};